<?php
/* v 0.0.0.1*/
  class tabletojson{
      public function GetAll($tableName){
          $ci =& get_instance();
          $ci->load->database();
          
          $query = $ci->db->get($tableName);
          
          $res = array();
          
          return $query->result();
      }
      
      public function GetByField($tableName, $whereArray){
          $ci =& get_instance();
          $ci->load->database();
          
          $query = $ci->db->get_where($tableName, $whereArray);
          
          $res = array();
          
          return $query->result();
      }
  }
?>
